<template>
  <div class="container">
    <Spin tip="注销中,请稍后..." />
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { Spin } from 'ant-design-vue'
import { useGo } from '@/hooks'
import { useOidcStoreWithOut } from '../oidcStore'

export default defineComponent({
  name: 'OidcSignoutCallback',
  components: { Spin: Spin },
  setup() {
    const go = useGo()

    const oidcStore = useOidcStoreWithOut()
    oidcStore
      .signOutOidcCallback()
      .then((signOutRes) => {
        go('/')
      })
      .catch((err) => {
        console.error(err)
        go('/signout-oidc-error')
      })
    return {}
  },
})
</script>

<style scoped>
.container {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate3d(-50%, -50%, 0);
}
</style>
